Skip to main content

Impression-level ad revenue

Impression-level ad revenue provides you with a granular calculation of how much revenue was generated by each ad impression.

The XMediator SDK provides this data on the ad's impression callback for you to use in your internal systems or any mobile measurement partner (MMP).

ImpressionData class

The ImpressionData class is passed as a parameter of the onImpression callbacks on each ad format.

FieldData typeDescription
revenuedoubleEstimated revenue that the ad generated.
ecpmdoubleEcpm value for the ad.
placementIdstringPlacement id of the waterfall used to load this ad.
adNetworkstringName of the network used to render this ad.
mediationstringName of the mediation service used to mediate this ad network.
subNetworkNameOptional<string>Name of the sub network used to render this ad, if available.
creativeIdOptional<string>Id of the creative rendered, if available.
adSpaceOptional<string>The name of the ad space provided when presenting the ad, if available.
waterfallResultLoadResultDescribes the result of the waterfall used to load this ad.
idstringUnique identifier generated for the impression.

SDK-to-SDK integration sample

MMPs usually recommend an SDK-to-SDK integration over a S2S/API one, as they are able to provide less revenue matching discrepancies, more data in real time, and tools such as SKAdNetwork conversion value management based on ad revenue.

// Interstitial example
class MyInterstitialListener : public x3mads::InterstitialAdsListener {
public:
void onImpression(const std::string& placementId, const x3mads::ImpressionData& impression) override {
const double revenue = impression.revenue;
const std::string& network = impression.adNetwork;
const std::string& unitId = impression.placementId;
const std::string& currency = "USD";

// Example (pseudo-code):
// TrackAdRevenue(revenue, currency, network, unitId);
}
};

auto* sdk = x3mads::XMediatorAds::getInstance();
static MyInterstitialListener s_listener; // Ensure it outlives registration
sdk->interstitial->addListener(&s_listener);